/**
 * 
 */
package com.atjava.nebula.core.dao.ibatis.projection;

/**投影工厂，通过该工厂创建新的投影对象
 * @author kyo
 *
 */
public class Projections {
	/**创建总和投影
	 * @param propertyName 字段名
	 * @return 返回投影对象
	 */
	static public Projection sum(String propertyName){
		return new Projection("sum",propertyName);
	}
	/**创建平均值投影
	 * @param propertyName 字段名
	 * @return 返回投影对象
	 */
	static public Projection avg(String propertyName){
		return new Projection("avg",propertyName);
	}
	/**创建最小值投影
	 * @param propertyName 字段名
	 * @return 返回投影对象
	 */
	static public Projection min(String propertyName){
		return new Projection("min",propertyName);		
	}	
	/**创建最大值投影
	 * @param propertyName 字段名
	 * @return 返回投影对象
	 */	
	static public Projection max(String propertyName){
		return new Projection("max",propertyName);
	}
	/**创建普通字段投影
	 * @param propertyName 字段名
	 * @return 返回投影对象
	 */	
	static public Projection property(String propertyName){
		return new Projection(propertyName,false);
	}	
	/**创建分组投影
	 * @param propertyName 字段名
	 * @return 返回投影对象
	 */	
	static public Projection groupProperty(String propertyName){
		return new Projection(propertyName,true);
	}		
	/**创建统计投影
	 * @return 返回投影对象
	 */
	static public  Projection count(){
		return new Projection("count","*","count");
	}			

}
